package course.d1217;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class date01 {
    public static void main(String[] args) {
//        Calendar s = Calendar.getInstance();
//        s.set(Calendar.YEAR,2020);
//        s.set(Calendar.MONTH,Calendar.JANUARY);
//        s.set(Calendar.DATE,16);
//        System.out.println(s.getTime());
//        int i = s.get(Calendar.DAY_OF_WEEK);
//        System.out.println(i);
        int year = 2019;

        Calendar c = Calendar.getInstance();
        c.set(Calendar.YEAR, year);
        c.set(Calendar.DATE, 1);
        for (int month = Calendar.JANUARY; month <= Calendar.DECEMBER; month++)
        {
            c.set(Calendar.MONTH, month);
            System.out.println(year + "年" + (month + 1) + "月：" + c.getActualMaximum(Calendar.DATE) + "天");
        }


        Calendar ss  = Calendar.getInstance();
        Date date = new Date();
        ss.setTime(date);
        date = ss.getTime();
        System.out.println(date);

        GregorianCalendar aa = new GregorianCalendar(2014,Calendar.JANUARY,1);
        System.out.println(aa.getTime());
    }
}

